package com.mediacloud.app.newsmodule.activity

import android.text.TextUtils
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.eventTrack.CDPTrackReportManager
import com.eventTrack.TXReportManager
import com.facebook.drawee.view.SimpleDraweeView
import com.mediacloud.app.assembly.util.loadByFresco
import com.mediacloud.app.model.news.ArticleItem
import com.mediacloud.app.newsmodule.R

class MoreVideoCollectionAdapter :
    BaseQuickAdapter<ArticleItem, BaseViewHolder>(R.layout.item_more_video) {
    override fun convert(helper: BaseViewHolder, item: ArticleItem) {
        val logo = helper.getView<SimpleDraweeView>(R.id.imageLogo)
        val tvtitle = helper.getView<TextView>(R.id.tvTitle)
        logo.loadByFresco(if (TextUtils.isEmpty(item.prop1)) item.logo else item.prop1)
        tvtitle.text = item.title
        if(TXReportManager.getInstance().firstTabInfo.tabName=="视听"){
            CDPTrackReportManager.getInstance().ShortVideoExpose(item,helper.absoluteAdapterPosition)
        }
    }
}